﻿using System;
using System.Diagnostics.Contracts;

namespace CardPlay.Model.ActionModel
{
    [ContractClass(typeof(CodeContractForIChangeHistory))]
    public interface IChangeHistory
    {
        bool CanUndo { get; }
        bool CanRedo { get; }

        void Undo();
        void Redo();
    }

    [ContractClassFor(typeof(IChangeHistory))]
    internal abstract class CodeContractForIChangeHistory : IChangeHistory
    {
        public bool CanUndo
        {
            get { throw new NotImplementedException(); }
        }

        public bool CanRedo
        {
            get { throw new NotImplementedException(); }
        }

        public void Redo()
        {
            Contract.Requires(CanRedo);
        }

        public void Undo()
        {
            Contract.Requires(CanUndo);
        }
    }
}
